using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Distance._Legacy
{
    /// <summary>
    /// <para>Cost Path As Polyline</para>
    /// <para>Calculates the least-cost path from a source to a destination as a line feature.</para>
    /// <para>将从源到目标的开销最低路径计算为线要素。</para>
    /// </summary>    
    [DisplayName("Cost Path As Polyline")]
    public class CostPathAsPolyline : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CostPathAsPolyline()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_destination_data">
        /// <para>Input raster or feature destination data</para>
        /// <para><xdoc>
        ///   <para>A raster or feature dataset that identifies those cells from which the least-cost path is determined to the least costly source.</para>
        ///   <para>If the input is a raster, it must consist of cells that have valid values for the destinations, and the remaining cells must be assigned NoData. Zero is a valid value.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>一个栅格或要素数据集，用于标识从中确定成本最低路径到成本最低源的像元。</para>
        ///   <para>如果输入为栅格，则该输入必须由具有目标有效值的像元组成，并且必须为其余像元分配 NoData。零是有效值。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_in_cost_distance_raster">
        /// <para>Input cost distance or euclidean distance raster</para>
        /// <para><xdoc>
        ///   <para>The cost distance raster to be used to determine the least-cost path from the sources to the destinations.</para>
        ///   <para>The cost distance raster is usually created with the Cost Distance, Cost Allocation, or Cost Back Link tools. The cost distance raster stores, for each cell, the minimum accumulative cost distance over a cost surface from each cell to a set of source cells.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于确定从源到目标的最低成本路径的成本距离栅格。</para>
        ///   <para>成本距离栅格通常使用成本距离、成本分摊或成本回溯链接工具创建。成本距离栅格存储每个像元在成本图面上从每个像元到一组源像元的最小累积成本距离。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_in_cost_backlink_raster">
        /// <para>Input cost backlink, back direction or flow direction raster</para>
        /// <para><xdoc>
        ///   <para>The cost backlink raster to be used to determine the path to return to a source via the least-cost path, or the shortest path.</para>
        ///   <para>For each cell in a backlink, back direction, or flow direction raster, the value identifies the neighbor that is the next cell on the path from that cell to a source cell.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于确定通过成本最低路径或最短路径返回源的路径的成本反向链接栅格。</para>
        ///   <para>对于反向链接、反向或流向栅格中的每个像元，该值用于标识从该像元到源像元的路径上的下一个像元的邻居。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_polyline_features">
        /// <para>Output polyline features</para>
        /// <para>The output feature class that will hold the least cost path.</para>
        /// <para>将保存成本最低路径的输出要素类。</para>
        /// </param>
        public CostPathAsPolyline(object _in_destination_data, object _in_cost_distance_raster, object _in_cost_backlink_raster, object _out_polyline_features)
        {
            this._in_destination_data = _in_destination_data;
            this._in_cost_distance_raster = _in_cost_distance_raster;
            this._in_cost_backlink_raster = _in_cost_backlink_raster;
            this._out_polyline_features = _out_polyline_features;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Cost Path As Polyline";

        public override string CallName => "sa.CostPathAsPolyline";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "autoCommit", "configKeyword", "geographicTransformations", "maintainSpatialIndex", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_destination_data, _in_cost_distance_raster, _in_cost_backlink_raster, _out_polyline_features, _path_type.GetGPValue(), _destination_field, _force_flow_direction_convention.GetGPValue()];

        /// <summary>
        /// <para>Input raster or feature destination data</para>
        /// <para><xdoc>
        ///   <para>A raster or feature dataset that identifies those cells from which the least-cost path is determined to the least costly source.</para>
        ///   <para>If the input is a raster, it must consist of cells that have valid values for the destinations, and the remaining cells must be assigned NoData. Zero is a valid value.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>一个栅格或要素数据集，用于标识从中确定成本最低路径到成本最低源的像元。</para>
        ///   <para>如果输入为栅格，则该输入必须由具有目标有效值的像元组成，并且必须为其余像元分配 NoData。零是有效值。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster or feature destination data")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_destination_data { get; set; }


        /// <summary>
        /// <para>Input cost distance or euclidean distance raster</para>
        /// <para><xdoc>
        ///   <para>The cost distance raster to be used to determine the least-cost path from the sources to the destinations.</para>
        ///   <para>The cost distance raster is usually created with the Cost Distance, Cost Allocation, or Cost Back Link tools. The cost distance raster stores, for each cell, the minimum accumulative cost distance over a cost surface from each cell to a set of source cells.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于确定从源到目标的最低成本路径的成本距离栅格。</para>
        ///   <para>成本距离栅格通常使用成本距离、成本分摊或成本回溯链接工具创建。成本距离栅格存储每个像元在成本图面上从每个像元到一组源像元的最小累积成本距离。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input cost distance or euclidean distance raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_cost_distance_raster { get; set; }


        /// <summary>
        /// <para>Input cost backlink, back direction or flow direction raster</para>
        /// <para><xdoc>
        ///   <para>The cost backlink raster to be used to determine the path to return to a source via the least-cost path, or the shortest path.</para>
        ///   <para>For each cell in a backlink, back direction, or flow direction raster, the value identifies the neighbor that is the next cell on the path from that cell to a source cell.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于确定通过成本最低路径或最短路径返回源的路径的成本反向链接栅格。</para>
        ///   <para>对于反向链接、反向或流向栅格中的每个像元，该值用于标识从该像元到源像元的路径上的下一个像元的邻居。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input cost backlink, back direction or flow direction raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_cost_backlink_raster { get; set; }


        /// <summary>
        /// <para>Output polyline features</para>
        /// <para>The output feature class that will hold the least cost path.</para>
        /// <para>将保存成本最低路径的输出要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output polyline features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_polyline_features { get; set; }


        /// <summary>
        /// <para>Path type</para>
        /// <para><xdoc>
        ///   <para>Specifies a keyword defining the manner in which the values and zones on the input destination data will be interpreted in the cost path calculations.</para>
        ///   <bulletList>
        ///     <bullet_item>Best single— For all cells on the input destination data, the least-cost path is derived from the cell with the minimum of the least-cost paths to source cells.</bullet_item><para/>
        ///     <bullet_item>Each zone— For each zone on the input destination data, a least-cost path is determined and saved on the output raster. With this option, the least-cost path for each zone begins at the cell with the lowest cost distance weighting in the zone.</bullet_item><para/>
        ///     <bullet_item>Each cell— For each cell with valid values on the input destination data, a least-cost path is determined and saved on the output raster. With this option, each cell of the input destination data is treated separately, and a least-cost path is determined for each cell.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定一个关键字，用于定义在成本路径计算中解释输入目标数据的值和区域的方式。</para>
        ///   <bulletList>
        ///     <bullet_item>最佳单像元 - 对于输入目标数据上的所有像元，开销最低的路径是从具有到源像元的最小开销路径的像元派生的。</bullet_item><para/>
        ///     <bullet_item>每个区域 - 对于输入目标数据上的每个区域，将确定一条成本最低的路径并将其保存在输出栅格上。使用此选项时，每个区域的最低成本路径从区域中成本距离加权最低的像元开始。</bullet_item><para/>
        ///     <bullet_item>每个像元 - 对于输入目标数据上具有有效值的每个像元，将确定一个成本最低的路径并将其保存在输出栅格上。使用此选项，将单独处理输入目标数据的每个单元格，并为每个单元格确定成本最低的路径。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Path type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _path_type_value _path_type { get; set; } = _path_type_value._BEST_SINGLE;

        public enum _path_type_value
        {
            /// <summary>
            /// <para>Best single</para>
            /// <para>Best single— For all cells on the input destination data, the least-cost path is derived from the cell with the minimum of the least-cost paths to source cells.</para>
            /// <para>最佳单像元 - 对于输入目标数据上的所有像元，开销最低的路径是从具有到源像元的最小开销路径的像元派生的。</para>
            /// </summary>
            [Description("Best single")]
            [GPEnumValue("BEST_SINGLE")]
            _BEST_SINGLE,

            /// <summary>
            /// <para>Each cell</para>
            /// <para>Each cell— For each cell with valid values on the input destination data, a least-cost path is determined and saved on the output raster. With this option, each cell of the input destination data is treated separately, and a least-cost path is determined for each cell.</para>
            /// <para>每个像元 - 对于输入目标数据上具有有效值的每个像元，将确定一个成本最低的路径并将其保存在输出栅格上。使用此选项，将单独处理输入目标数据的每个单元格，并为每个单元格确定成本最低的路径。</para>
            /// </summary>
            [Description("Each cell")]
            [GPEnumValue("EACH_CELL")]
            _EACH_CELL,

            /// <summary>
            /// <para>Each zone</para>
            /// <para>Each zone— For each zone on the input destination data, a least-cost path is determined and saved on the output raster. With this option, the least-cost path for each zone begins at the cell with the lowest cost distance weighting in the zone.</para>
            /// <para>每个区域 - 对于输入目标数据上的每个区域，将确定一条成本最低的路径并将其保存在输出栅格上。使用此选项时，每个区域的最低成本路径从区域中成本距离加权最低的像元开始。</para>
            /// </summary>
            [Description("Each zone")]
            [GPEnumValue("EACH_ZONE")]
            _EACH_ZONE,

        }

        /// <summary>
        /// <para>Destination field</para>
        /// <para><xdoc>
        ///   <para>The field to be used to obtain values for the destination locations.</para>
        ///   <para>Input feature data must contain at least one valid field.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于获取目标位置值的字段。</para>
        ///   <para>输入要素数据必须至少包含一个有效字段。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Destination field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _destination_field { get; set; } = null;


        /// <summary>
        /// <para>Force flow direction convention for backlink raster</para>
        /// <para><xdoc>
        ///   <para>Forces the tool to treat the input backlink raster as a flow direction raster. Flow direction rasters can have integer values that range from 0-255.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—The Input cost backlink raster will be interpreted differently based on the range of values and if it is integer or float. For a value range of 0-8, the Input cost backlink raster will be treated as a backlink raster. For values 0-255 and integer, the Input cost backlink raster will be treated as a flow direction raster. For a value range of 0-360 and floating point, the Input cost backlink raster will be treated as a back direction raster.</bullet_item><para/>
        ///     <bullet_item>Checked—The raster supplied for the Input cost backlink raster will be treated as a flow direction raster. This is necessary if the flow direction raster has a maximum value of 8 or less.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>强制工具将输入反向链接栅格视为流向栅格。流向栅格的整数值范围为 0-255。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 输入成本反向链接栅格将根据值范围以及是整数还是浮点数而以不同的方式解释。对于值范围 0-8，输入成本反向链接栅格将被视为反向链接栅格。对于值 0-255 和整数，输入成本反向链接栅格将被视为流向栅格。对于值范围 0-360 和浮点，输入成本反向链接栅格将被视为反向栅格。</bullet_item><para/>
        ///     <bullet_item>选中 - 为输入成本反向链接栅格提供的栅格将被视为流向栅格。如果流向栅格的最大值为 8 或更小，则这是必需的。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Force flow direction convention for backlink raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _force_flow_direction_convention_value _force_flow_direction_convention { get; set; } = _force_flow_direction_convention_value._false;

        public enum _force_flow_direction_convention_value
        {
            /// <summary>
            /// <para>INPUT_RANGE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("INPUT_RANGE")]
            [GPEnumValue("false")]
            _false,

            /// <summary>
            /// <para>FLOW_DIRECTION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FLOW_DIRECTION")]
            [GPEnumValue("true")]
            _true,

        }

        public CostPathAsPolyline SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, int? autoCommit = null, object configKeyword = null, object geographicTransformations = null, bool? maintainSpatialIndex = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, autoCommit: autoCommit, configKeyword: configKeyword, geographicTransformations: geographicTransformations, maintainSpatialIndex: maintainSpatialIndex, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}